package com.zimin.cloud.system.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zimin.cloud.mine.pojo.system.business.DeptBO;
import com.zimin.cloud.system.biz.IDeptBiz;
import com.zimin.cloud.system.controller.api.IDeptController;
import com.zimin.cloud.system.pojo.entity.Dept;
import com.zimin.shared.pojo.BaseController;
import com.zimin.shared.pojo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 部门 前端控制器
 * </p>
 *
 * @author zimin
 * @since 2021-12-30 11:05
 */
@RestController
public class DeptController extends BaseController implements IDeptController {


    @Autowired
    private IDeptBiz deptBiz;

    @Override
    public Result deptTree(DeptBO deptBO) {
        return result(deptBiz.deptTree(deptBO));
    }

    @Override
    public Result save(DeptBO deptBO) {
        return result(deptBiz.save(deptBO));
    }

    @Override
    public Result update(DeptBO deptBO) {
        return result(deptBiz.updateById(deptBO));
    }

    @Override
    public Result delete(List<String> idList) {
        return result(deptBiz.removeByIds(idList));
    }

}
